/* 请求函数配置 */
import API from 'ser/apis';
import Request from 'ser/request';

// 登录
export async function login(params) {
  return Request({
    url: API.LOGIN,
    data: params,
    isForm: 1,
    isToken: 0,
  });
}

//注册
export async function signup(params) {
  return Request({
    url: API.SIGNUP,
    data: params,
    isForm: 0,
    isToken: 0,
    method: 'POST',
  });
}

// 修改密码
export async function updatePwd(params) {
  return Request({
    url: API.UPDATE_PWD,
    data: params,
    isForm: 1,
    isToken: 1,
  });
}

// 查询仓库 运力总需求数
export async function getDemandNum(params) {
  return Request({
    url: API.DEMAND_NUM,
    data: params,
    isForm: 0,
  });
}

// 查询访问量
export async function getVisNum(params) {
  return Request({
    url: API.FIND_VISNUM,
    data: params,
    isForm: 0,
  });
}

// 增加访问量
export async function updateVisNum(params) {
  return Request({
    url: API.UPDATE_VISNUM,
    data: params,
    isForm: 0,
  });
}

// 查询稳产满产
export async function findFullBack(params) {
  return Request({
    url: API.LIST_FULLBACK,
    data: params,
    isForm: 0,
    isToken: 1,
    method: 'POST',
  });
}

// 查询稳产满产详情
export async function findFullBackDetail(id) {
  return Request({
    url: API.DETAIL_FULLBACK + '/' + id,
    isForm: 0,
    isToken: 1,
  });
}

// 新增稳产满产
export async function addFullBack(params) {
  return Request({
    url: API.ADD_FULLBACK,
    data: params,
    isForm: 0,
    isToken: 1,
    method: 'POST',
  });
}

// 查询地点
export async function getSite(params) {
  return Request({
    url: API.QUERY_SITE,
    data: params,
    isForm: 0,
  });
}

// 字典接口
export async function getDicType(params) {
  return Request({
    url: API.GET_DIC_TYPE,
    data: params,
    isForm: 0,
    isToken: 1,
  });
}
// 仓储需求列表
export async function getStorageList(params) {
  return Request({
    url: API.QUERY_STORAGE_LIST,
    data: params,
    isForm: 0,
    method: 'POST',
  });
}

// 仓储需求详情
export async function getStorageDetail(id) {
  return Request({
    url: API.QUERY_STORAGE_DETAIL + '/' + id,
    isForm: 0,
  });
}

// 仓储需求发布
export async function addStorage(params) {
  return Request({
    url: API.ADD_STORAGE,
    data: params,
    isForm: 0,
    isToken: 1,
    method: 'POST',
  });
}

// 货源需求列表
export async function getSupplyList(params) {
  return Request({
    url: API.QUERY_SUPPLY_LIST,
    data: params,
    isForm: 0,
    method: 'POST',
  });
}

// 货源需求详情
export async function getSupplyDetail(id) {
  return Request({
    url: API.QUERY_SUPPLY_DETAIL + '/' + id,
    isForm: 0,
  });
}

// 填报物流企业
export async function addWlqy(params) {
  return Request({
    url: API.ADD_WLQY,
    data: params,
    isForm: 0,
    isToken: 1,
    method: 'POST',
  });
}

// 查询运力或仓储企业列表
export async function getCompAddList(params) {
  return Request({
    url: API.GET_COMPADD_LIST,
    data: params,
    isForm: 0,
    method: 'POST',
  });
}

// 查询运力或仓储企业详情
export async function getCompAddDetail(id) {
  return Request({
    url: API.GET_COMPADD_DETAIL + '/' + id,
    isForm: 0,
  });
}

// 仓储需求发布
export async function addSupply(params) {
  return Request({
    url: API.ADD_SUPPLY,
    data: params,
    isForm: 0,
    isToken: 1,
    method: 'POST',
  });
}

// 富文本
export async function getRich(id) {
  return Request({
    url: API.GET_RICH + '/' + id,
    isForm: 0,
    isToken: 1,
  });
}

//完善企业信息
export async function updateCompanyInfo(params) {
  return Request({
    url: API.UPDATE_COMPANY_IFNO,
    data: params,
    isForm: 0,
    isToken: 1,
    method: 'POST',
  });
}

//获取企业信息
export async function queryCompanyInfo(params) {
  return Request({
    url: API.QUERY_COMPANY_INFO,
    data: params,
    isForm: 0,
    isToken: 1,
    method: 'POST',
  });
}
